package net.dipper.tankwar.editor.helper;

import java.awt.Graphics2D;
import java.awt.Image;
import java.io.IOException;

import net.dipper.tankwar.core.config.BackgroundItem;

import wnb.util.io.ImageManager;

public class BackgroundRenderer implements ObjectRenderer {
	private BackgroundItem item;
	
	public BackgroundRenderer(BackgroundItem item){
		this.item = item;
	}

	@Override
	public void renderSelection(Graphics2D g2, int x, int y, int gW, int gH) {
		try {
			Image img =  ImageManager.getImage(item.getImg());
			g2.drawImage(img, x * gW, y * gH, gW, gH, null);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
